#include "SeqStack.h"

typedef struct PERSON {
    char name[64];
    int age;
}Person;

int main() {
    //创建栈
    SeqStack* stack = Init_SeqStack();
    //创建数据
    Person p1 = {"aaa",18};
    Person p2 = {"bbb",19};
    Person p3 = {"ccc",20};
    Person p4 = {"ddd",21};
    Person p5 = {"eee",22};

    //入栈
    Push_SeqStack(stack,&p1);
    Push_SeqStack(stack,&p2);
    Push_SeqStack(stack,&p3);
    Push_SeqStack(stack,&p4);
    Push_SeqStack(stack,&p5);

    //输出
    while (Size_SeqStack(stack) > 0) {
        //出栈
        Person* person = (Person *) Pop_SeqStack(stack);
        printf("Name:%s Age:%d\n",person->name,person->age);
    }

    printf("%d\n",IsEmpty(stack));

    FreeSpace_SeqStack(stack);

    return 0;
}